package aboutTheBook;

public class BookShelf {
    private Book[] bookList = new Book[10];//使用bookList对书进行存放
    private int size;//当前书的数量

    //构造方法
    public BookShelf() {
        bookList[0] = new Book("文学经典","西游记","吴承恩","文学库");
        bookList[1] = new Book("文学经典","三国演义","罗贯中","文学库");
        bookList[2] = new Book("文学经典","红楼梦","曹雪芹","文学库");
        bookList[3] = new Book("文学经典","水浒传","施耐庵","文学库");
        size=4;
    }

    //设置书架方法
    public void setBookList(Book[] bookList) {
        this.bookList = bookList;
    }
    public void setSize(int size) {
        this.size = size;
    }
    //设置pos位置数据
    public void setPosBook(int pos, Book book) {
        bookList[pos] = book;
    }

    //获取书架方法
    public Book[] getBookList() {
        return this.bookList;
    }
    public int getSize() {
        return this.size;
    }
}
